<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:msxsl="urn:schemas-microsoft-com:xslt"
      xmlns:user="SQL Sharper"
>
<msxsl:script language="C#" implements-prefix="user">
	public string toLower(string str)
	{
		return str.ToLower();
	}
	public string toUpper(string str)
	{
		return str.ToUpper();
	}
	public string toCamel(string str)
	{
		if(str.Length &lt;= 3)
		return str.ToLower();
		return str[0].ToString().ToLower()+str.Substring(1);	
	}
	public string toPascal(string str)
	{
		return str[0].ToString().ToUpper()+str.Substring(1);
	}
	
	public string stringLeft(string str,int startIndex)
	{
		return str.Substring(startIndex);
	}

	public string getDbType(string datatype)
	{
		switch(datatype)
		{
			case "bigint":return "SqlDbType.BigInt";
			case "binary":return "SqlDbType.Binary";
			case "bit":return "SqlDbType.Bit";
			case "char":return "SqlDbType.Char";
			case "datetime":return "SqlDbType.DateTime";
			case "decimal":return "SqlDbType.Decimal";
			case "float":return "SqlDbType.Float";
			case "image":return "SqlDbType.Image";
			case "int":return "SqlDbType.Int";
			case "money":return "SqlDbType.Money";
			case "nchar":return "SqlDbType.NChar";
			case "ntext":return "SqlDbType.NText";
			case "numeric":return "SqlDbType.Decimal";
			case "nvarchar":return "SqlDbType.NVarChar";
			case "real":return "SqlDbType.Real";
			case "smalldatetime":return "SqlDbType.SmallDateTime";
			case "smallint":return "SqlDbType.SmallInt";
			case "smallmoney":return "SqlDbType.SmallMoney";
			case "text":return "SqlDbType.Text";
			case "timestamp":return "SqlDbType.Timestamp";
			case "tinyint":return "SqlDbType.TinyInt";
			case "uniqueidentifier":return "SqlDbType.UniqueIdentifier";
			case "varbinary":return "SqlDbType.VarBinary";
			case "varchar":return "SqlDbType.VarChar";
			case "xml":return "SqlDbType.Xml";
			case "sql_variant":return "SqlDbType.Variant";
		}
		return "Unknown";	
	}
</msxsl:script> 
</xsl:stylesheet>

